package com.majun.controller;

import com.majun.service.RocketMqService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class MqController {


    @Resource
    private RocketMqService rocketMqService;


    @RequestMapping({"/", "/index"})
    public Object showIndex() {

        return "index";
    }


    @PostMapping("/send/{type}")
    public Object showIndex(@PathVariable String type,String message) {
        rocketMqService.send(type, message);
        return "success";
    }

}
